<template>
  <div class="login-container flx-center">
    <div class="login-box">
      <SwitchDark class="dark" />
      <div class="login-left"></div>
      <div class="login-form">
        <div class="login-logo">
          <h2 class="logo-text">欢迎登录</h2>
          <br />
          <h4 class="logo-text">YiNuoIOT工业设备数字化与智能应用平台</h4>
        </div>
        <LoginForm v-if="showLoginForm" @toggle-form-view="toggleFormView" />
        <ForgetPasswordForm v-else @toggle-form-view="toggleFormView"></ForgetPasswordForm>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts" name="login">
import { ref } from 'vue'
import LoginForm from './components/LoginForm.vue'
import ForgetPasswordForm from './components/ForgetPasswordForm.vue'
import SwitchDark from '@/components/SwitchDark/index.vue'
const showLoginForm = ref(true) // 初始显示登录表单

const toggleFormView = () => {
  showLoginForm.value = !showLoginForm.value
}
</script>

<style scoped lang="scss">
@import './index.scss';
</style>
